#include <stdio.h>

int main(int argc, char** argv) {
	int limit = atoi(argv[1]);
	int a = 1;
	int b = 2;
	extern int fibsum(int, int, int, int);
	int sum = fibsum(a, b, 0, limit);
	printf("%d\n", sum);
	return(0);
}

int fibsum(int a, int b, int sum, int limit) {
	if (b < limit) {
		if (b % 2 == 0) {
			sum = sum + b;
		}
		return fibsum(b, a + b, sum, limit);
	} else {
		return sum;
	}
}

